﻿<button class="btn btn-primary" @onclick="@ShowBottomMessage">打开消息提示</button>

<Message @ref="MessageElement" />

@code {
    private Message MessageElement { get; set; }

    [Inject] public MessageService? MessageService { get; set; }

    private void ShowBottomMessage()
    {
        MessageElement.SetPlacement(Placement.Bottom);
        MessageService?.Show(new MessageOption()
        {
            Host = MessageElement,
            Content = "这是一条提示消息",
            Icon = "fa fa-info-circle",
        });
    }
}
